<template>
  <div>
    <input v-model="message" />
    <button type="button" @click="encryptMessage">encryptMessage</button>
    <input v-model="encryptedMessage" />
    <button type="button" @click="decryptMessage">decryptMessage</button>
  </div>
</template>
<script>
// 在Vue组件中引入CryptoJS库

export default {
  name: 'name',
  mixins: [], //混入
  components: {}, //组件
  props: {}, //集成属性
  data() {
    return {
      message: '18650742120',
      encryptedMessage: '18650742120',
      decryptedMessage: '',
    };
  },
  computed: {},

  methods: {
    encryptMessage() {
      let msg = this.$encryption.encrypt(this.message);
      console.log(msg);
      this.encryptedMessage = msg;
    },
    decryptMessage() {
      // this.decryptedMessage = CryptoJS.enc.Utf8.stringify(decrypted);
    },
  },
};
</script>
<style lang="less" scoped></style>
